package com.sg.xy.service.impl;

import com.sg.xy.dao.CodeDao;
import com.sg.xy.pojo.AuthCode;
import com.sg.xy.service.AuthCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

/**
 * @Author jw.liang
 * @Date 2020/9/16
 */
@Service
public class AuthCodeServiceImpl implements AuthCodeService {
    @Autowired
    private CodeDao codeDao;

    @Override
    public AuthCode getByEmail(String email) {
        // 最近⼀次的验证码记录 order by createTime desc
        return codeDao.findFirstByEmailOrderByCreatetimeDesc(email);
    }
}
